package com.diy.sigmund.diyorder.feign.client;

import com.diy.sigmund.diycommon.entity.ResultMsg;
import com.diy.sigmund.diyorder.entity.dto.UserAuthDTO;
import com.diy.sigmund.diyorder.feign.fallback.FeignFallbackFactory;
import com.diy.sigmund.diyorder.feign.fallback.UserClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author ylm-sigmund
 * @since 2021/4/18 15:35
 */
//@FeignClient(value = "diy-user", url = "http://127.0.0.1:8081")
@FeignClient(value = "diy-user", contextId = "UserClient", fallbackFactory = FeignFallbackFactory.class)
public interface UserClient {

    @PostMapping("/user/userAuth/login")
    ResultMsg login(UserAuthDTO dto);

    @PostMapping(value = "/user/receiveFile", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    ResultMsg receiveFile(@RequestPart("file") MultipartFile file,
            @RequestPart("file1") MultipartFile file1,
            @RequestParam String name,
            @RequestParam String phone);
}


